<div class="item">
    <div class="cont">
        <div class="files">
            <div class="files-item clearfix">
                <div class="files-item-label">单位材料</div>
                <div class="files-item-files">
                    @if ($department->file_type == \App\Models\Department::FILE_TYPE_BZ_SHUZHI)
                        <span>
                            @if ($department->file && $department->file->ppt_filepath && file_exists(file_local_path($department->file->ppt_filepath)))
                                <a target="_blank" href="{{ admin_route('department.file.download', ['id' => $department->file->id, 'office_file_type' => 'ppt']) }}">述职PPT</a>
                            @else
                                述职PPT（暂无）
                            @endif
                        </span>
                        @if ($department->file && $department->file->pdf_filepath && file_exists(file_local_path($department->file->pdf_filepath)))
                            <span><a href="javascript:void(0)" class="read-file" data-url="{{ admin_route('department.file.read', ['id' => $department->file->id, 'office_file_type' => 'pdf']) }}">述职PPT转PDF版本</a></span>
                        @else
                            <span>述职PPT转PDF版本（暂无）</span>
                        @endif
                    @endif
                    @if ($department->file_type == \App\Models\Department::FILE_TYPE_BZ_KHB)
                        @if ($department->file && $department->file->pdf_filepath && file_exists(file_local_path($department->file->pdf_filepath)))
                            <span><a href="javascript:void(0)" class="read-file" data-url="{{ admin_route('department.file.read', ['id' => $department->file->id, 'office_file_type' => 'pdf']) }}">班子考核表</a></span>
                        @else
                            <span>班子考核表（暂无）</span>
                        @endif
                    @endif
                    @if ($department->file_type == \App\Models\Department::FILE_TYPE_DJ_SHUZHI)
                        <span>
                            @if ($department->file && $department->file->ppt_filepath && file_exists(file_local_path($department->file->ppt_filepath)))
                            <a target="_blank" href="{{ admin_route('department.file.download', ['id' => $department->file->id, 'office_file_type' => 'ppt']) }}">述职PPT</a>
                            @else
                            述职PPT（暂无）
                            @endif
                        </span>
                        @if ($department->file && $department->file->pdf_filepath && file_exists(file_local_path($department->file->pdf_filepath)))
                            <span><a href="javascript:void(0)" class="read-file" data-url="{{ admin_route('department.file.read', ['id' => $department->file->id, 'office_file_type' => 'pdf']) }}">述职PPT转PDF版本</a></span>
                        @else
                            <span>述职PPT转PDF版本（暂无）</span>
                        @endif
                    @endif
                    @if ($department->file_type == \App\Models\Department::FILE_TYPE_DJ_GZZJ)
                        @if ($department->file && $department->file->pdf_filepath && file_exists(file_local_path($department->file->pdf_filepath)))
                            <span><a href="javascript:void(0)" class="read-file" data-url="{{ admin_route('department.file.read', ['id' => $department->file->id, 'office_file_type' => 'pdf']) }}">党建工作总结</a></span>
                        @else
                            <span>党建工作总结（暂无）</span>
                        @endif
                    @endif
                </div>
            </div>
            @if ($department->fushus && count($department->fushus) > 0)
                <div class="files-item">
                    <div class="files-item-label">附属单位</div>
                    <div class="files-item-files">
                        @foreach ($department->fushus as $department_fushu)
                            @if ($department_fushu->filepath && file_exists(file_local_path($department_fushu->filepath)))
                            <span><a href="javascript:void(0)" class="read-file" data-url="{{ admin_route('department.file.read', ['id' => $department_fushu->id, 'show_type' => 'fushu']) }}">{{ $department_fushu->fs_dwmc }}</a></span>
                            @else
                            {{ $department_fushu->fs_dwmc }}
                            @endif
                        @endforeach
                    </div>
                </div>
            @endif
            @if ($personals && count($personals) > 0)
                <div class="files-item">
                    <div class="files-item-label">姓名</div>
                    <div class="files-item-files">
                        @foreach ($personals as $staff)
                            @if ($staff->filepath && file_exists(file_local_path($staff->filepath)))
                                <span><a href="javascript:void(0)" class="read-file" data-url="{{ admin_route('department.file.read', ['id' => $staff->id, 'show_type' => 'staff']) }}">{{ $staff->name }} </a></span>
                            @else
                                <span>{{ $staff->name }}</span>
                            @endif
                        @endforeach
                    </div>
                </div>  
            @endif
        </div>
    </div>
</div>  